<%- model_class = User.new.class -%>
<div class="page-header">
  <h1><%=t '.title', :default => model_class.model_name.human.pluralize %></h1>
</div>
<div class='row'>
<div class='span12'>
<table class="table table-striped">
  <thead>
    <tr>
      <th><%= model_class.human_attribute_name(:id) %></th>
      <th><%= model_class.human_attribute_name(:name) %></th>
      <th><%= model_class.human_attribute_name(:hometown) %></th>
      <th><%= model_class.human_attribute_name(:sign_in_count) %></th>
      <th><%= model_class.human_attribute_name(:last_sign_in_at) %></th>
      <th><%= model_class.human_attribute_name(:created_at) %></th>
      <th>Friendships</th>
    </tr>
  </thead>
  <tbody>
    <% @users.each do |user| %>
      <tr id='<%= user.id %>'>
        <td><%= link_to user.id, user_path(user) %></td>
        <td><%= user.name %></td>
        <td><%= user.hometown %></td>
        <td><%= user.sign_in_count %></td>
        <td><%= user.last_sign_in_ip %></td>
        <td><%=l user.created_at %></td>
        <td>
          <%= button_friendship(user) %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>
</div>
</div>
<div class="row">
<div class='span4'>
<%= link_to("My Profile", home_user_path(current_user), :class => 'btn btn-inverse') %>
<%= link_to("Logout", destroy_user_session_path, :method => :delete, :class => 'btn btn-danger') %>
</div>
</div>
